package com.neusoft.controller.disposal;

import com.neusoft.service.DisposalRequestService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;

import java.util.List;
import java.util.Map;

@RestController
@CrossOrigin
@RequestMapping("/disposal")
public class DisposalRequestController {
    @Autowired
    DisposalRequestService disposalRequestService;
    @GetMapping("/getFinishDisposal")
    public Integer getFinishDisposal(){
        Integer finishCheck = disposalRequestService.getFinishDisposal();
        return finishCheck;
    }
    @GetMapping("/getWaitRegisterIdList")
    public List<Integer> getWaitRegisterIdList(){
        List<Integer> registerIdList = disposalRequestService.getWaitRegisterIdList();
        return registerIdList;
    }
    @PutMapping("/updateDisposalRequestTable")
    public void updateDisposalRequestTable(Integer disposalId, Integer employeeId){
        disposalRequestService.updateDisposalRequestTable(disposalId,employeeId);
    }
    @GetMapping("/searchDisposal")
    public List<Map<String,Object>> searchDisposal(@RequestParam Integer registerId) {
        return disposalRequestService.searchDisposalItems(registerId);
    }

}
